<?php 
if(!isset($nombre1)) { $nombre1 = ""; }
if(!isset($nombre2)) { $nombre2 = ""; }
if(!isset($resultat)) { $resultat = ""; }
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="ISO-8859-1">
        <title>Calculatrice magique</title>
        <link href="bootstrap/css/bootstrap.css" type="text/css" rel="stylesheet">
        <style>
            .form-control {
                width: 150px;
            }
        </style>
    </head>
    <body>
        <form name="form1" id="form1" action="traitement_formulaire.php" method="post">
            <div><input type="number" name="nombre1" id="nombre1" class="form-control" value="<?php echo $nombre1; ?>"></div>
            <div><input type="number" name="nombre2" id="nombre2" value="<?php echo $nombre2; ?>" ></div>
            <div>
                <select name="operateur" id="operateur">
                    <option>+</option>
                    <option>-</option>
                    <option>x</option>
                    <option>:</option>
                </select>
            </div>
            <div><button type="submit" id="bouton" class="btn btn-primary"><span class="glyphicon glyphicon-calendar"></span> Calculer</button></div>
            <div><input type="number" name="resultat" id="resultat" readonly="readonly" value="<?php echo $resultat; ?>" ></div>
        </form>
    </body>
</html>
